<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateShopLicenseRecordsLog extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('cruise_shop_license_records_log', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('shopId')->default(0)->comment('门店ID');

            $table->tinyInteger('type')->default(0)->comment('类型:1-营业执照,2-食品许可证');
            $table->tinyInteger('operateType')->default(0)->comment('操作类型:0-系统,1-内部,2-后台,3-商家');
            $table->tinyInteger('actionType')->default(0)->comment('行为类型,具体见model的actionTypeMap');

            $table->string('remark', 255)->default('')->comment('备注');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->tinyInteger("isDeleted")->default(0)->comment("是否删除,0:未删除,1:已删除");
            $table->index('shopId', 'idx_shopId');

            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '门店执照备案操作记录表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_license_records_log');
    }
}
